﻿@using CleanArchitecture.Infrastructure.Entities.System.DataDic
@using CleanArchitecture.Infrastructure.Models.SystemManage
@model SystemDataDicTreeSearchModel
@{
    Layout = "_BackendLayout";
    ViewData["Title"] = ViewBag.PageTitle as string;
    int currentSystemModuleId = ViewBag.CurrentSystemModuleId;
    var datadictreeRoots = Model.CustomProperties["datadictreeRoots"] as IList<SystemDataDicTree> ?? null;
}
@section csslinks{
    <link rel="stylesheet" href="/js/backend/modules/numberInput/numberInput.css" />
}
<div class="systemdatadicmanage layui-main">
    <div class="layui-row layui-col-220">
        <div class="layui-collapse" lay-accordion="" lay-filter="datadictree">
            @foreach (var treeGroupNode in datadictreeRoots)
            {
                <div class="layui-colla-item" data-treeid="@treeGroupNode.Id" data-treegroup="@((int)treeGroupNode.GroupType)">
                    <h2 class="layui-colla-title">@treeGroupNode.DisplayName</h2>
                    <div class="layui-colla-content"></div>
                </div>
            }
        </div>
    </div>
    <div id="rightpanel" class="right-col-body">
        @await Html.PartialAsync("_OrganizeTreeManage", Model)
        @await Html.PartialAsync("_SystemDataDicManage", Model)
    </div>

    <div id="datadicgroups" class="layui-hide">
        @foreach (var treeGroupNode in datadictreeRoots)
        {
            <input type="text" data-treegroup="@((int)treeGroupNode.GroupType)" data-treegroupname="@treeGroupNode.GroupType.ToString()" />
        }
    </div>
</div>
<input type="text" class="layui-hide" id="currentSystemModuleId" value="@currentSystemModuleId" />
<!-- 表格行排序设置-->
<script type="text/html" id="displayorderTpl">
    <span style="cursor: pointer; font-size: 16px;">{{d.displayorder}}</span>
</script>
<!-- 设置排序弹框-->
<script type="text/html" id="displayorderInputTpl">
    <div style="padding: 30px 50px;">
        <div class="layui-numbox" style="width: 180px;">
            <button class="layui-btn-numbox-minus" type="button">-</button>
            <input class="layui-input-numbox" type="number" value="0">
            <button class="layui-btn-numbox-plus" type="button">+</button>
        </div>
    </div>
</script>
@await Component.InvokeAsync("RecordButton")
<script type="text/html" id="isActiveTpl">
    <input type="checkbox" value="{{d.IsActive}}" lay-skin="switch" lay-text="ON|OFF" {{ d.IsActive ? 'checked' : '' }}>
</script>
@section scripts{
    <script src="~/js/backend/systemmanage/systemdatadicmanage.min.js" charset="utf-8" asp-append-version="true"></script>
}
